﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class kecheng_kecheng_manage1_jigou : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["sourceUrl"] = Context.Request.UrlReferrer;	 //读取来源URL
            DetailsView1.FieldHeaderStyle.Width = 80;

        }
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        if (Session["sourceUrl"] != null)
        {
            Response.Redirect(Session["sourceUrl"].ToString());
        }
    }


    protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        ////string str = ((DropDownList)GridView3.Rows[e.RowIndex].Cells[0].FindControl("DropDownList1")).SelectedValue;
        //string str1 = ((DropDownList)DetailsView1.FindControl("ddlfenlei1")).SelectedValue;
        //string str2 = ((DropDownList)DetailsView1.FindControl("ddlfenlei2")).SelectedValue;
        //string str3 = ((DropDownList)DetailsView1.FindControl("ddlfenlei3")).SelectedValue;
        ////string str4 = ((DropDownList)DetailsView1.FindControl("ddlkaibanzt")).SelectedValue;
        //string str5 = ((DropDownList)DetailsView1.FindControl("ddlkechenglx")).SelectedValue;
        //e.NewValues["fenlei1"] = str1;
        //e.NewValues["fenlei2"] = str2;
        //e.NewValues["fenlei3"] = str3;
        ////e.NewValues["kaibanzt"] = str4;
        //e.NewValues["kechenglx"] = str5;

    }
    protected void ddlkechenglx_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList listlx = (DropDownList)DetailsView1.FindControl("ddlkechenglx");
        TextBox txtxuefei_update = (TextBox)DetailsView1.FindControl("txtxuefei");
        if (listlx.SelectedValue == "免费课程")
        {
            txtxuefei_update.Text = "0";
            txtxuefei_update.Enabled = false;
        }
        else
        {
            txtxuefei_update.Enabled = true;

        }
    }
}